package com.easyhouse.controller;

import com.easyhouse.common.pojo.Message;
import com.easyhouse.common.vo.EasyUIResult;
import com.easyhouse.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/message/manage")
public class MessageController {
    @Autowired
    private MessageService messageService;
    @RequestMapping("/publish")
    public void insertMessage(Message message){
        System.out.println(message.getUserName());
        messageService.insertMessage(message);
    }
    @RequestMapping("/selectContent")
    public EasyUIResult selectMessage(String houseId){
        EasyUIResult result = messageService.selectMessage(houseId);
        return result;
    }
}
